<script type="text/javascript" src="__STATIC__/admin/hui/lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="__STATIC__/admin/hui/lib/layer/2.4/layer.js"></script>

<script type="text/javascript" src="__STATIC__/admin/hui/static/h-ui/js/H-ui.min.js"></script>
<!-- <script type="text/javascript" src="__STATIC__/admin/hui/static/h-ui.admin/js/H-ui.admin.js"></script> -->

<!--请在下方写此页面业务相关的脚本-->
<!-- <script type="text/javascript" src="__STATIC__/admin/hui/lib/jquery.contextmenu/jquery.contextmenu.r2.js"></script> -->
{load href="__STATIC__/admin/js/common.js"}

<!-- 判断 input和textarea 是否超过长度来伸缩展开,在class类名加上input-text -->
<script type="text/javascript">
    // 获取当前输入数据来判断
    $(".table-style .input-text").bind('input porpertychange',function(){
        var vInput = $(this).val();
        var sInput = vInput.length;
        var english = /^[a-zA-Z0-9_~:!@#$%^&*()+=,./?-]+$/;
        if(english.test(vInput)){
            if(sInput > 50) {
                $(this).css('width','84%');
            } else {
                $(this).css('width','450px');
            }
        } else {
            if(sInput > 29) {
                $(this).css('width','84%');
            } else {
                $(this).css('width','450px');
            }
        }
    });

    // 获取已有数据来判断
    $(".table-style .input-text").each(function(){
        var vInputs = $(this).val();
        var sInputs = vInputs.length;
        var englishs = /^[a-zA-Z0-9_~:!@#$%^&*()+=,./?-]+$/;
        if(englishs.test(vInputs)){
            if(sInputs > 50) {
                $(this).css('width','84%');
            } else {
                $(this).css('width','450px');
            }
        } else {
            if(sInputs > 29) {
                $(this).css('width','84%');
            } else {
                $(this).css('width','450px');
            }
        }
    });
</script>